home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / commonToleranceProperties.me < prev    next >
Encoding:
Text File  |  2003-07-17  |  7.2 KB  |  219 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  4 Dec 1996
  22. //  Author:         sgs
  23. //
  24. //  Description:
  25. //        These procs create the controls for a common modelling tolerances in 
  26. //        the property sheets and attribute windows.
  27. //
  28. //  Input Arguments:
  29. //       string $parent
  30. //    string $node
  31. //    string $positionalTolerance    IF you want a positional tolerance wiget  "showPositionalTolerance"
  32. //    string $tangentTolerance     IF you want a tangent tolerance wiget  "showTangentTolerance"
  33. //    string $curvatureTolerance      IF you want a curvature tolerance wiget "showCurvatureTolerance"
  34. //
  35. //  Return Value:
  36. //      None.
  37. //  
  38.  
  39. //
  40. //  Description:
  41. //      Connect the controls for all of the controls in the commonToleranceProperties dialog.
  42. //
  43. //
  44. global proc commonToleranceHistoryLink( string $parent, string $node,
  45.                     string $positionalTolerance,
  46.                     string $tangentTolerance, 
  47.                     string $curvatureTolerance )
  48. {
  49.     setParent $parent ;
  50.     
  51.     if ($positionalTolerance == "showPositionalTolerance")
  52.     {
  53.         // c(0) tolerance.
  54.         //
  55.         connectControl commonPositionalTolerance($node + ".pt");
  56.     }
  57.  
  58.     if ($tangentTolerance == "showTangentTolerance")
  59.     {
  60.         // g(1) tolerance.
  61.         //
  62.         connectControl commonTangentTolerance($node + ".tt");
  63.     }
  64.  
  65.     if ($curvatureTolerance == "showCurvatureTolerance")
  66.     {
  67.         // g(2) tolerance.
  68.         //
  69.         connectControl commonTangentTolerance($node + ".ct");
  70.     }
  71.     
  72. }
  73.  
  74. //
  75. //  Description:
  76. //      Set the callbacks for all of the controls in the commonToleranceProperties dialog.
  77. //      In simple terms show or hide tolerance stuff based on what is required by the tool
  78. //
  79. //
  80. global proc commonToleranceValues( string $parent, string $showSpecificTolerances, 
  81.                         string $showPositionalTolerance,
  82.                         string $showTangentTolerance,
  83.                         string $showCurvatureTolerance) 
  84. {
  85.  
  86.     setParent $parent;
  87.  
  88.     // Should any tolerances be shown, If so pop that tab foward, else hide all the tolerance stuff
  89.     if ($showSpecificTolerances == "showSpecificTolerances")
  90.     {
  91.         tabLayout -e -selectTab dontShowTolerance_Tab specificTolerance_Tabs;
  92.         radioButtonGrp -e
  93.             -on1 ("tabLayout -e -selectTab dontShowTolerance_Tab specificTolerance_Tabs;")
  94.             -on2 ("tabLayout -e -selectTab showTolerance_Tab specificTolerance_Tabs;")
  95.             commonToleranceOptions;
  96.     
  97.         // Should position tolerance be shown, If so pop that tab foward, 
  98.         // else hide postion the tolerance stuff
  99.         if ($showPositionalTolerance == "showPositionalTolerance")
  100.         {
  101.             tabLayout -e -selectTab showTolerancePosition_Tab tolerancePosition_Tabs;
  102.         }
  103.         else
  104.         {
  105.             tabLayout -e -selectTab dontShowTolerancePosition_Tab tolerancePosition_Tabs;
  106.         }
  107.  
  108.         // Should tangent tolerance be shown, If so pop that tab foward, 
  109.         // else hide tangent the tolerance stuff
  110.         if ($showTangentTolerance == "showTangentTolerance")
  111.         {
  112.             tabLayout -e -selectTab showToleranceTangent_Tab toleranceTangent_Tabs;
  113.         }
  114.         else
  115.         {
  116.             tabLayout -e -selectTab dontShowToleranceTangent_Tab toleranceTangent_Tabs;
  117.         }
  118.  
  119.         // Should Curvature tolerance be shown, If so pop that tab foward, 
  120.         // else hide Curvature the tolerance stuff
  121.         if ($showCurvatureTolerance == "showCurvatureTolerance")
  122.         {
  123.             tabLayout -e -selectTab showToleranceCurvature_Tab toleranceCurvature_Tabs;
  124.         }
  125.         else
  126.         {
  127.             tabLayout -e -selectTab dontShowToleranceCurvature_Tab toleranceCurvature_Tabs;
  128.         }
  129.     } else
  130.     {
  131.         tabLayout -e -selectTab dontShowTolerance_Tab specificTolerance_Tabs;
  132.         radioButtonGrp -e
  133.             -on1 ("tabLayout -e -selectTab dontShowTolerance_Tab specificTolerance_Tabs;")
  134.             -on2 ("tabLayout -e -selectTab showTolerance_Tab specificTolerance_Tabs;")
  135.             commonToleranceOptions;
  136.     }
  137. }
  138.  
  139. //
  140. //  Description:
  141. //        This procedure builds the standard modeling tolerances but by 
  142. //        default none of them are shown. If your procedure needs them
  143. //        use the commonToleranceValues procedure passing
  144. //        IF you want a positional tolerance wiget pass in "showPositionalTolerance"
  145. //        IF you want a tangent tolerance wiget pass in "showTangentTolerance"
  146. //        IF you want a curvature tolerance wiget pass in "showCurvatureTolerance"
  147. //
  148. global proc commonToleranceProperties( string $parent, string $node,
  149.                     string $positionalTolerance,
  150.                     string $tangentTolerance, 
  151.                     string $curvatureTolerance )
  152. {
  153.     setParent $parent;
  154.     setUITemplate -pushTemplate DefaultTemplate;
  155.     frameLayout -l "Tolerances" -borderVisible false -labelIndent 20 commonTolerance_Frame;
  156.         columnLayout  commonTolerance_Column;
  157.  
  158.             radioButtonGrp -nrb 2 -l "Use Tolerance"
  159.                 -l1 "Global"
  160.                 -l2 "Local" 
  161.                 -select 1
  162.                 commonToleranceOptions;
  163.  
  164.             tabLayout -childResizable true -tabsVisible false specificTolerance_Tabs;
  165.                 columnLayout dontShowTolerance_Tab;
  166.                 setParent ..;
  167.  
  168.                 columnLayout -adj true showTolerance_Tab;
  169.                     tabLayout -childResizable true -tabsVisible false tolerancePosition_Tabs;
  170.                         columnLayout -adj true dontShowTolerancePosition_Tab;
  171.                         setParent ..;
  172.  
  173.                         columnLayout -adj true showTolerancePosition_Tab;
  174.                             separator -style "none" -h 1;
  175.                             floatSliderGrp -l "Positional"
  176.                                 -min 0.0001 -max 1.0 -fmn 0.00001 -fmx 1000.0
  177.                                 commonPositionalTolerance;
  178.                         setParent ..;
  179.                     setParent ..;
  180.  
  181.                     tabLayout -childResizable true -tabsVisible false toleranceTangent_Tabs;
  182.                         columnLayout dontShowToleranceTangent_Tab;
  183.                         setParent ..;
  184.  
  185.                         columnLayout  -adj true showToleranceTangent_Tab;
  186.                                   floatSliderGrp -l "Tangent"
  187.                                 -min 0.0001 -max 1.0 -fmn 0.00001 -fmx 1000.0
  188.                                 commonTangentTolerance;
  189.                         setParent ..;
  190.                     setParent ..;
  191.  
  192.                     tabLayout -childResizable true -tabsVisible false toleranceCurvature_Tabs;
  193.                         columnLayout dontShowToleranceCurvature_Tab;
  194.                         setParent ..;
  195.  
  196.                         columnLayout -adj true showToleranceCurvature_Tab;
  197.                                   floatSliderGrp -l "Curvature"
  198.                                 -min 0.0001 -max 1.0 -fmn 0.00001 -fmx 1000.0
  199.                                 commonCurvatureTolerance;
  200.                         setParent ..;
  201.                     setParent ..;
  202.                 setParent ..;
  203.             setParent ..;
  204.         setParent ..;
  205.     setParent ..;
  206.  
  207.     setUITemplate -popTemplate;
  208.     commonToleranceValues( $parent, "showSpecificTolerances", 
  209.                     $positionalTolerance,
  210.                     $tangentTolerance, 
  211.                     $curvatureTolerance);
  212.     commonToleranceHistoryLink ($parent, $node,  
  213.                     $positionalTolerance,
  214.                     $tangentTolerance, 
  215.                     $curvatureTolerance);
  216.  
  217.  
  218. }
  219.